#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
typedef long long LL;
const LL MAXN=1e5+7;
const LL MOD=1e9+7;
LL dp[MAXN];
int main() {
	string s;
	LL n;
	cin>>s>>n;
	int len=s.length();
	dp[len]=1;
	for (LL i=len+1; i<=n; ++i) {
		dp[i]=(dp[i-1]*(26+25*(i-1)))%MOD;
	}
	cout<<dp[n]<<endl;
	return 0;
}
